#pragma once
#include "common.h"

class TreadCache
{
public:
    void *Allocate(size_t size);
    void Dellocate(void *obj,size_t size);
    // 向下一层申请内存
    void *FetchFromCentralCache(size_t index,size_t size);
    void ListToLong(FreeList& List,size_t size);
    //慢启动阈值
    size_t ThresholdValue = 1;
private:
    FreeList _freeList[NFREELIST];
};
static __thread TreadCache* pTLSThreadCache;
// declspec的变量每一个线程都存在一份独有的
//vs下使用
// static __declspec(thread) TreadCache* pTLSThreadCache = nullptr;
// static TreadCache* pTLSThreadCache = nullptr;





